﻿using CatLib.Container;
using GameFramework.ObjectPool;

namespace GameFramework.UI.FairyGUI
{
    /// <summary>
    /// FairyGUI窗体 对象池模块
    /// </summary>
    public partial class AFairyGUIFormLogic
    {
        public IObjectPool ObjectPool
        {
            get
            {
                m_ObjectPool ??= CatLib.App.That.Make<IObjectPool>();
                return m_ObjectPool;
            }
        }

        private IObjectPool m_ObjectPool;

        private void _OnRecycleObjectPool()
        {
            if (m_ObjectPool == null)
                return;
            
            m_ObjectPool.Dispose();
            m_ObjectPool = null;
        }
    }
}